package org.xvergabe.forms.poc.pdfgenerator;

import org.xvergabe.xsd.forms.components.x20.Address;

import com.lowagie.text.Document;
import com.lowagie.text.pdf.PdfWriter;

/**
 * Class to write an Address Component to a PDF 
 * @author schiller
 *
 */
public class AddressPdfWriter implements XmlPdfWriter<Address>{

	@Override
	public void writePdfFromXml(Address address, PdfWriter writer, Document document) {
		
		StringInputFieldPdfWriter stringFieldPdfWriter = new StringInputFieldPdfWriter();
		
		stringFieldPdfWriter.writePdfFromXml(address.getStreet(), writer, document);
		stringFieldPdfWriter.writePdfFromXml(address.getNumber(), writer, document);
		stringFieldPdfWriter.writePdfFromXml(address.getPostalCode(), writer, document);
		stringFieldPdfWriter.writePdfFromXml(address.getCity(), writer, document);
		
	}

}
